<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>WiFi Logger component: udp_handler.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">WiFi Logger component
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">WiFi Logger component, uses wifi to output logs</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">udp_handler.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="udp__handler_8h_source.html">udp_handler.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for udp_handler.c:</div>
<div class="dyncontent">
<div class="center"><img src="udp__handler_8c__incl.png" border="0" usemap="#udp__handler_8c" alt=""/></div>
<map name="udp__handler_8c" id="udp__handler_8c">
<area shape="rect" id="node2" href="udp__handler_8h.html" title="udp_handler.h" alt="" coords="981,80,1084,107"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a412aa3402fc47e327861b48a04c3c08a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp__handler_8c.html#a412aa3402fc47e327861b48a04c3c08a">network_manager</a> (struct <a class="el" href="structnetwork__data.html">network_data</a> *nm)</td></tr>
<tr class="memdesc:a412aa3402fc47e327861b48a04c3c08a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Manages UDP connection to the server.  <a href="#a412aa3402fc47e327861b48a04c3c08a">More...</a><br /></td></tr>
<tr class="separator:a412aa3402fc47e327861b48a04c3c08a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ddbd791c1d13c96db95eba36aae6145"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp__handler_8c.html#a7ddbd791c1d13c96db95eba36aae6145">send_data</a> (struct <a class="el" href="structnetwork__data.html">network_data</a> *nm, char *payload)</td></tr>
<tr class="memdesc:a7ddbd791c1d13c96db95eba36aae6145"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends data to the server through a UDP socket.  <a href="#a7ddbd791c1d13c96db95eba36aae6145">More...</a><br /></td></tr>
<tr class="separator:a7ddbd791c1d13c96db95eba36aae6145"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fe113c2ad2a7617b3600bc09ab220e9"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp__handler_8c.html#a6fe113c2ad2a7617b3600bc09ab220e9">receive_data</a> (struct <a class="el" href="structnetwork__data.html">network_data</a> *nm)</td></tr>
<tr class="memdesc:a6fe113c2ad2a7617b3600bc09ab220e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receives data from UDP server.  <a href="#a6fe113c2ad2a7617b3600bc09ab220e9">More...</a><br /></td></tr>
<tr class="separator:a6fe113c2ad2a7617b3600bc09ab220e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e138ed94c89bd74c249c9f4a1a4c642"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp__handler_8c.html#a3e138ed94c89bd74c249c9f4a1a4c642">close_network_manager</a> (struct <a class="el" href="structnetwork__data.html">network_data</a> *nm)</td></tr>
<tr class="memdesc:a3e138ed94c89bd74c249c9f4a1a4c642"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shutdown active connection, deallocate memory.  <a href="#a3e138ed94c89bd74c249c9f4a1a4c642">More...</a><br /></td></tr>
<tr class="separator:a3e138ed94c89bd74c249c9f4a1a4c642"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a3e138ed94c89bd74c249c9f4a1a4c642"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e138ed94c89bd74c249c9f4a1a4c642">&#9670;&nbsp;</a></span>close_network_manager()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void close_network_manager </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetwork__data.html">network_data</a> *&#160;</td>
          <td class="paramname"><em>nm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Shutdown active connection, deallocate memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nm</td><td><a class="el" href="structtcp__network__data.html">tcp_network_data</a> struct which contains connection info </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

</div>
</div>
<a id="a412aa3402fc47e327861b48a04c3c08a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a412aa3402fc47e327861b48a04c3c08a">&#9670;&nbsp;</a></span>network_manager()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void network_manager </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetwork__data.html">network_data</a> *&#160;</td>
          <td class="paramname"><em>nm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Manages UDP connection to the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nm</td><td><a class="el" href="structnetwork__data.html">network_data</a> struct which contains necessary data for a UDP connection </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>

</div>
</div>
<a id="a6fe113c2ad2a7617b3600bc09ab220e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fe113c2ad2a7617b3600bc09ab220e9">&#9670;&nbsp;</a></span>receive_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* receive_data </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetwork__data.html">network_data</a> *&#160;</td>
          <td class="paramname"><em>nm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receives data from UDP server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nm</td><td><a class="el" href="structnetwork__data.html">network_data</a> struct which contains connection info </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>char array which contains data received </dd></dl>

</div>
</div>
<a id="a7ddbd791c1d13c96db95eba36aae6145"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ddbd791c1d13c96db95eba36aae6145">&#9670;&nbsp;</a></span>send_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int send_data </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structnetwork__data.html">network_data</a> *&#160;</td>
          <td class="paramname"><em>nm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>payload</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends data to the server through a UDP socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">nm</td><td>A pointer to <a class="el" href="structnetwork__data.html">network_data</a> struct </td></tr>
    <tr><td class="paramname">payload</td><td>char array which contains data to be sent </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int - returns -1 if sending failed, number of bytes sent if successfully sent the data </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
